package com.wwp.tbshop.accout_center.presenter;

import com.wwp.tbshop.model.bean.BaseBean;
import com.wwp.tbshop.model.bean.ExitBean;
import com.wwp.tbshop.presenter.BasePresenter;
import com.wwp.tbshop.view.fragment.UserFragment;

import retrofit2.Call;

/**
 * Created by Administrator on 6/17/2017.
 */

public class ExitUser_presenter extends BasePresenter{

    public UserFragment mUserFragment;

    public ExitUser_presenter(UserFragment userFragment) {
        mUserFragment = userFragment;
    }


    public void ExitUserNewsInfo(String userid) {
        Call<ExitBean> userInfoBeanCall = mApiService.exitUser(userid);
        userInfoBeanCall.enqueue(mCallback);
    }

    @Override
    protected void onServerBug(int code) {

    }

    @Override
    protected void onConnectError(String message) {

    }

    @Override
    protected void onSuccess(BaseBean baseBean) {

        String error_code = baseBean.getError_code();

        if (error_code==null){
            ExitBean exitBean = (ExitBean) baseBean;
            mUserFragment.onSuccess(exitBean);
        }


    }


}
